export const timeToNumber = (dateStr) => {
    const date = new Date(dateStr);
    const year = date.getFullYear();
    const month = date.getMonth() + 1;
    const day = date.getDate();
    const hours = date.getHours();
    const minutes = date.getMinutes();
    const seconds = date.getSeconds();
    const formatNumber = (n) => n < 10 ? '0' + n : n;
    // return `${year}-${formatNumber(month)}-${formatNumber(day)} ${formatNumber(hours)}:${formatNumber(minutes)}:${formatNumber(seconds)}`
    return {
        year,
        month:formatNumber(month),
        day:formatNumber(day),
        hours:formatNumber(hours),
        minutes: formatNumber(minutes),
        seconds: formatNumber(seconds),
    }
}